<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUnitsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('units', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name')->default('')->comment('单位名称');
            $table->unsignedInteger('user_count')->default('0')->comment('总人数');
            $table->unsignedInteger('test_count')->default('0')->comment('参加考试人数');
            $table->unsignedInteger('full_count')->default('0')->comment('满分人数');
            $table->float('average_score')->default('0')->comment('平均分');
            $table->unsignedInteger('order')->default('0')->comment('排序');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('units');
    }
}
